﻿<UserControl x:Class="Test.Silverlight.DataGrid.TotalSummaries"
    xmlns="http://schemas.microsoft.com/client/2007" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:Test.Silverlight.DataGrid;assembly=Test.Silverlight.DataGrid"
    xmlns:grid="clr-namespace:DevExpress.AgDataGrid;assembly=DevExpress.AgDataGrid.v8.2">

    <UserControl.Resources>
        <DataTemplate x:Name="OptionsPanelTemplate">
            <StackPanel x:Name="OptionsPanel" Orientation="Horizontal" Loaded="OptionsPanel_Loaded">
                <TextBlock Text="Summaries:" VerticalAlignment="Center" Margin="0,0,6,0"/>
                <RadioButton x:Name="rbStandard"  IsChecked="true" Checked="rb_Checked" GroupName="1" Margin="0,0,10,0" Content="Standard"/>
                <RadioButton x:Name="rbCustom" Checked="rb_Checked" GroupName="1" Margin="0,0,10,0" Content="Custom"/>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">        
        <grid:AgDataGrid x:Name="grid" CustomSummary="grid_CustomSummary" ColumnsAutoWidth="True" ShowTotals="Visible" ShowGroupPanel="Visible"
                         SelectionMode="MultiSelection" SelectionChanged="grid_SelectionChanged">
            <grid:AgDataGrid.Resources>
                <local:CurrencyToStringConverter x:Name="CurrencyToStringConverter"/>
            </grid:AgDataGrid.Resources>
            <grid:AgDataGrid.Columns>
                <grid:AgDataGridTextColumn FieldName="Trademark"/>
                <grid:AgDataGridTextColumn FieldName="Model" Width="60"/>
                <grid:AgDataGridTextColumn FieldName="HP" Width="67"/>
                <grid:AgDataGridTextColumn FieldName="Liter" Width="72"/>
                <grid:AgDataGridTextColumn FieldName="MPGCity" HeaderContent="MPG City" Width="103"/>
                <grid:AgDataGridTextColumn FieldName="MPGHighway" HeaderContent="MPG Highway" Width="80"/>
                <grid:AgDataGridTextColumn FieldName="Category" Width="70"/>
                <grid:AgDataGridColumn FieldName="Price">
                    <grid:AgDataGridColumn.CellDisplayTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding CellValue, Converter={StaticResource CurrencyToStringConverter}}"/>
                        </DataTemplate>
                    </grid:AgDataGridColumn.CellDisplayTemplate>
                </grid:AgDataGridColumn>
            </grid:AgDataGrid.Columns>
        </grid:AgDataGrid>
    </Grid>
    
</UserControl>
